package jdbc;

import java.sql.*;

public class jdbcDemo {
    public static void main(String[] args) throws Exception {
        //Class.forName("com.mysql.cj.jdbc.Driver");
        String url="com.mysql:///account";
        String username="root";
        //定义一个字符串变量，用于存储密码
        String password="080666";

        Connection conn = DriverManager.getConnection(url, username, password);

        String sql="update account set money =3000 where id = 1";
        Statement statement = conn.createStatement();
        //受影响的行数
        int i = statement.executeUpdate(sql);

        System.out.println(i);


        statement.close();
        conn.close();


    }

}
